package com.leetcode.basic;

/**
 * @author Dennis Li
 * @date 2020/6/11 20:14
 */
public class ListNode {

    public int val;
    public ListNode next;
    public ListNode(int x){
        val = x;
        next = null;
    }

    public static ListNode createListNode(int[] nums) {
        ListNode dummyHead = new ListNode(0), cur = dummyHead;
        for (int num : nums) {
            ListNode node = new ListNode(num);
            cur.next = node;
            cur = cur.next;
        }
        return dummyHead.next;
    }

}
